import { ObjCreate } from "../common/ObjCreate";
import { Language } from "../../../../extend/language/Language";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ImagesConst } from "../../resource/ImagesConst";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { BaseItem } from "../common/BaseItem";
import { ItemData } from "../../resource/info/ItemData";
import { BuffItem } from "../avatar/BuffItem";
import { SkillStateConfig } from "../../resource/SkillStateConfig";
import { BuffInfo } from "../avatar/BuffInfo";
//class ChristmasCardGoodTipsPart
    
    export  class ChristmasCardGoodTipsPart /* flash.display.Sprite */
    {
        constructor(arg1: string, arg2: Array<any>)
        {
            
            this._sourceArr = [];
            this._mainStr = arg1;
            this._sourceArr = arg2;
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            var loc4=null;
            var loc5=null;
            var loc6=0;
            var loc7=null;
            var loc8=null;
            var loc9=null;
            var loc10=null;
            var loc11=null;
            var loc1=ObjCreate.createTextField(Language.getString(71225), 45, 3, 65, 20, this, new GTextFormat(FontUtil.songtiName, 13, 16711935, true));
            var loc2=[71221, 71222, 71223];
            var loc3=0;
            while (loc3 < 3) 
            {
                ObjCreate.createBg(6, 22 + 58 * loc3, 140, 2, this, ImagesConst.SplitLine);
                loc7 = ObjCreate.createTextField(Language.getString(loc2[loc3]) + "：", 4, 23 + 57 * loc3, 86, 20, this, GlobalStyle.textFormat2);
                ++loc3;
            }
            loc6 = 0;
            while (loc6 < 6) 
            {
                if (loc6 > 0) 
                {
                    (loc4 = GlobalClass.getBitmap(ImagesConst.PackItemBg)).x = 30 + loc6 % 2 * 60;
                    loc4.y = 43 + Math.floor(loc6 / 2) * 57;
                    this.addChild(loc4);
                    if (loc6 != 2) 
                    {
                        (loc5 = new BaseItem()).setSize(32, 32);
                        loc5.x = loc4.x + 3;
                        loc5.y = loc4.y + 3;
                        this.addChild(loc5);
                    }
                }
                if (loc6 != 0) 
                {
                    if (loc6 == 1 || loc6 == 3) 
                    {
                        if ((loc8 = new ItemData(this._sourceArr[(loc6 - 1)])) && loc8.itemInfo) 
                        {
                            loc5.itemData = loc8;
                        }
                    }
                    else if (loc6 == 4 || loc6 == 5) 
                    {
                        loc5.source = this._sourceArr[(loc6 - 1)] + ".jpg";
                        if (loc6 != 4) 
                        {
                            loc5.toolTipData = Language.getString(40363);
                        }
                        else if (this._mainStr != Language.getString(71210)) 
                        {
                            loc5.toolTipData = Language.getString(36175) + " +100";
                        }
                        else 
                        {
                            loc5.toolTipData = Language.getString(36175) + " +50";
                        }
                    }
                    else if (loc6 == 2) 
                    {
                        (loc9 = new BuffItem()).setSize(32, 32);
                        loc9.move(loc4.x + 3, loc4.y + 3);
                        addChild(loc9);
                        loc10 = SkillStateConfig.instance.getInfoByName(this._sourceArr[(loc6 - 1)]);
                        (loc11 = new BuffInfo()).tstate = loc10;
                        loc9.buffInfo = loc11;
                    }
                }
                ++loc6;
            }
            return;
        }

        /* internal */ /* var */_mainStr: string;

        /* internal */ /* var */_sourceArr: Array<any>;
    }
